package com.example.my_project.auto_v2.controller;

import com.example.my_project.auto_v2.pojo.JsonResult;
import com.example.my_project.auto_v2.pojo.PathEntity;
import com.example.my_project.auto_v2.service.IPathService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: chenbo
 * @Description:
 * @Date: Created in 16:56 2018/7/25
 * @Modified By:
 */
@RestController
@RequestMapping(value = "Api")
public class IPathController {

    @Autowired
    IPathService iPathService;

    @GetMapping(value = "FindPath")
    public JsonResult findAll(){
        return iPathService.findAll();
    }

    @GetMapping(value = "FindApi")
    public JsonResult findApi(){
        return iPathService.findApi();
    }

    @PostMapping(value = "AddPath")
    public JsonResult addPath(@RequestBody PathEntity pathEntity){
        return iPathService.savePath( pathEntity );
    }
}
